

* ============================================================================================================ *
* Understanding Resourcing Trade-offs in International Organizations: Evidence from an Elite Survey Experiment *
* Authors: Mirko Heinzel, Bernhard Reinsberg & Christian Siauwijaya                                            *
* Version: 19.12.2024                                                                                          *
* Stata 16.2                                                                                                   *
* ===========================================================================================================  *

cd "Location of unzipped files"

cd "/Users/mirkoheinzel/Documents/Publications/Multi-bi/Survey/Survey_staff/JOP/1_submission/RR/CA/Post-accept/Replication_Final"

*ssc install plottig
*ssc install cmp

************************
*Figure 1: IO selection*
************************

use "MOPAN_EM.dta", clear
twoway (scatter y1 EMLT, mlab(acr)) ,  scheme(plotplainblind) ytitle(Process performance) xtitle(Average earmarking share) legend(off) xline(0.6, lcolor(sky)) yline(0, lcolor(sky))

*******************************
*Figure 2: conjoint experiment*
*******************************

use "Heinzel_Reinsberg_Siauwijaya_24_ACCEPT.dta", clear

*overhead
cmp setup
eststo m1: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( overhead_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe), indicators($cmp_cont $cmp_cont) iterate(50) difficult 
margins country own_area project sector length source i.io_fe, atmeans predict(eq(#1)) force post
eststo overhead1

eststo m2: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( overhead_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe)  , indicators($cmp_probit $cmp_cont) iterate(50) difficult 
margins country own_area project sector length source i.io_fe, atmeans predict(eq(#2)) force post
eststo overhead2

*amount
eststo m3: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( amount_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe)  , indicators($cmp_cont $cmp_cont) iterate(50) difficult 
margins country own_area project sector length source i.io_fe, atmeans predict(eq(#1)) force post
eststo amount1

eststo m4: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( amount_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe) , indicators($cmp_probit $cmp_cont) iterate(50) difficult 
margins country own_area project sector length source i.io_fe, atmeans predict(eq(#2)) force post
eststo amount2

*Coefficient plot

*overhead
coefplot overhead1 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(overhead1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(0.05)0.3)

coefplot overhead2 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(overhead2, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(2)20)

*amount
coefplot amount1 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(amount1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(0.05)0.3)

coefplot amount2 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(amount2, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(2)20)

graph combine amount2 overhead2, scheme(plotplainblind) 


******************************
*Figure 3: Rejection of funds*
******************************


eststo m1: cmp (refuse = i.country i.length i.own_area i.project i.sector i.source i.io_fe) ( overhead_clean = i.country i.length i.own_area i.project i.sector i.source i.io_fe)  , indicators($cmp_cont $cmp_cont) iterate(50) difficult 
margins country length own_area project sector source i.io_fe, atmeans predict(eq(#1)) force post
eststo rejection1

coefplot rejection1 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(rejection1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(0.05)0.3)


*************************
*Figure 4: Forced choice*
*************************

reg choicevar_clean  i.country i.sector i.project i.own_area i.length i.source i.io_fe
margins country sector project own_area length source i.io_fe, atmeans force post
eststo choice1

coefplot choice1 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(choice1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0.2(0.1)0.8)


*****************************
*******Appendix************
*****************************


******************************
*Figure A1: Statistical power*
******************************

*create "power_combined.dta" file using "Power_calculations.R" file
use "power_combined.dta", clear
keep n power estimate
tostring power, replace
replace power = subinstr(power, ".", "_",.)
reshape wide n , i(estimate) j(power, string)

label var n_7 "Power = 0.7"
label var n_8 "Power = 0.8"
label var n_9 "Power = 0.9"

graph twoway  (line n_7 estimate) (line n_8 estimate) (line n_9 estimate, lcolor(gs12)) , yline(3873, lcolor(sky)) scheme(plotplainblind) xlabel(0.22(0.11)1.1)



****************************************
*Figure A2: re-weight based on UN staff*
****************************************

use "Heinzel_Reinsberg_Siauwijaya_24_ACCEPT.dta", clear

*overhead
cmp setup
eststo m1: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( overhead_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe) [pw=mean_weight], indicators($cmp_cont $cmp_cont) iterate(50) difficult 
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#1)) force post
eststo overhead1

eststo m2: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( overhead_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe) [pw=mean_weight] , indicators($cmp_probit $cmp_cont) iterate(50) difficult 
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#2)) force post
eststo overhead2

*amount
eststo m3: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( amount_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe)  [pw=mean_weight], indicators($cmp_cont $cmp_cont) iterate(50) difficult 
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#1)) force post
eststo amount1

eststo m4: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( amount_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe) [pw=mean_weight], indicators($cmp_probit $cmp_cont) iterate(50) difficult 
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#2)) force post
eststo amount2

*Coefficient plot

*overhead
coefplot overhead1 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(overhead1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(0.05)0.3)

coefplot overhead2 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(overhead2, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(2)20)

*amount
coefplot amount1 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(amount1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(0.05)0.3)

coefplot amount2 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(amount2, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(2)20)

graph combine amount2 overhead2, scheme(plotplainblind) 

*****************************************
*Figure A3: Clusters at individual-level*
*****************************************

*overhead
cmp setup
eststo m1: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( overhead_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe) , indicators($cmp_cont $cmp_cont) iterate(50) difficult vce(cluster id)
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#1)) force post
eststo overhead1

eststo m2: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( overhead_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe)  , indicators($cmp_probit $cmp_cont) iterate(50) difficult vce(cluster id)
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#2)) force post
eststo overhead2

*amount
eststo m3: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( amount_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe)  [pw=mean_weight], indicators($cmp_cont $cmp_cont) iterate(50) difficult vce(cluster id)
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#1)) force post
eststo amount1

eststo m4: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( amount_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe) [pw=mean_weight], indicators($cmp_probit $cmp_cont) iterate(50) difficult vce(cluster id)
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#2)) force post
eststo amount2

*Coefficient plot

*overhead
coefplot overhead1 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(overhead1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(0.05)0.3)

coefplot overhead2 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(overhead2, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(2)20)

*amount
coefplot amount1 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(amount1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(0.05)0.3)

coefplot amount2 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(amount2, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(2)20)

graph combine amount2 overhead2, scheme(plotplainblind) 

******************************************
*Figure A4: Clustered SEs and re-weighted*
******************************************

*overhead
cmp setup
eststo m1: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( overhead_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe) [pw=mean_weight], indicators($cmp_cont $cmp_cont) iterate(50) difficult vce(cluster id)
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#1)) force post
eststo overhead1

eststo m2: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( overhead_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe) [pw=mean_weight] , indicators($cmp_probit $cmp_cont) iterate(50) difficult vce(cluster id)
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#2)) force post
eststo overhead2

*amount
eststo m3: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( amount_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe)  [pw=mean_weight], indicators($cmp_cont $cmp_cont) iterate(50) difficult vce(cluster id)
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#1)) force post
eststo amount1

eststo m4: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( amount_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe) [pw=mean_weight], indicators($cmp_probit $cmp_cont) iterate(50) difficult vce(cluster id)
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#2)) force post
eststo amount2

*Coefficient plot

*overhead
coefplot overhead1 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(overhead1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(0.05)0.3)

coefplot overhead2 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(overhead2, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(2)20)

*amount
coefplot amount1 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(amount1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(0.05)0.3)

coefplot amount2 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(amount2, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(2)20)

graph combine amount2 overhead2, scheme(plotplainblind) 

**************************************************************
*Figure A5: Country- and sector-focused staff--funding amount*
**************************************************************

reg overhead_clean i.country i.sector i.project i.own_area i.length i.source i.io_fe if q11=="Country-focused staff"
margins country sector project own_area length source i.io_fe, atmeans force post
eststo overhead_country

reg overhead_clean i.country i.sector i.project i.own_area i.length i.source i.io_fe  if q11=="Sector-focused staff"
margins country sector project own_area length source i.io_fe, atmeans force post
eststo overhead_sector

reg amount_clean i.country i.sector i.project i.own_area i.length i.source i.io_fe if q11=="Country-focused staff"
margins country sector project own_area length source i.io_fe, atmeans  force post
eststo amount_country

reg amount_clean i.country i.sector i.project i.own_area i.length i.source i.io_fe  if q11=="Sector-focused staff"
margins country sector project own_area length source i.io_fe, atmeans  force post
eststo amount_sector

coefplot overhead_country overhead_sector , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(overhead1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  


********************************************************
*Figure A6: Country- and sector-focused staff--overhead*
********************************************************

coefplot amount_country amount_sector , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(amount1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  


******************************************
*Figure A7: Results by IO: funding amount*
******************************************

reg overhead_clean i.country i.sector i.project i.own_area i.length i.source  if IO=="FAO", cluster(id) 
margins country sector project own_area length source , atmeans force post
eststo overhead_FAO

reg overhead_clean i.country i.sector i.project i.own_area i.length i.source   if IO=="UNDP", cluster(id) 
margins country sector project own_area length source , atmeans force post
eststo overhead_UNDP

reg overhead_clean i.country i.sector i.project i.own_area i.length i.source   if IO=="UNICEF", cluster(id) 
margins country sector project own_area length source , atmeans force post
eststo overhead_UNICEF

reg overhead_clean i.country i.sector i.project i.own_area i.length i.source   if IO=="UNFPA", cluster(id) 
margins country sector project own_area length source , atmeans force post
eststo overhead_UNFPA

reg amount_clean i.country i.sector i.project i.own_area i.length i.source  if IO=="FAO", cluster(id) 
margins country sector project own_area length source , atmeans force post
eststo amount_FAO

reg amount_clean i.country i.sector i.project i.own_area i.length i.source   if IO=="UNDP", cluster(id) 
margins country sector project own_area length source , atmeans force post
eststo amount_UNDP

reg amount_clean i.country i.sector i.project i.own_area i.length i.source   if IO=="UNICEF", cluster(id) 
margins country sector project own_area length source , atmeans force post
eststo amount_UNICEF

reg amount_clean i.country i.sector i.project i.own_area i.length i.source  if IO=="UNFPA", cluster(id) 
margins country sector project own_area length source, atmeans force post
eststo amount_UNFPA

coefplot amount_FAO amount_UNDP amount_UNICEF amount_UNFPA, xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(amount1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  


************************************
*Figure A8: Results by IO--overhead*
************************************

coefplot overhead_FAO overhead_UNDP overhead_UNICEF overhead_UNFPA, xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(overhead1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  

**********************************
*Figure A9: Distribution overhead*
**********************************

hist overhead_clean, scheme(plotplainblind)

*********************************
*Figure A10: Distribution amount*
*********************************

hist amount_clean, scheme(plotplainblind)

********************************
*Figure A11: Poisson regression*
********************************

poisson overhead_clean i.country i.sector i.project i.own_area i.length i.source  i.io_fe , cluster(id) 
margins country sector project own_area length source io_fe, atmeans force post
eststo Amount_pois1

poisson amount_clean i.country i.sector i.project i.own_area i.length i.source  i.io_fe , cluster(id) 
margins country sector project own_area length source io_fe, atmeans force post
eststo Overhead_pois1

coefplot Amount_pois1, xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(Amount_pois1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(2)20)

coefplot Overhead_pois1, xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(Overhead_pois1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(2)20)

graph combine Amount_pois1 Overhead_pois1, scheme(plotplainblind) 

*******************************************
*Figure A12: Distribution--overheads (log)*
*******************************************

hist log_overhead, scheme(plotplainblind)

****************************************
*Figure A13: Distribution--amount (log)*
****************************************

hist log_amount, scheme(plotplainblind)

************************
*Figure A14: Logged DVs*
************************

*overhead
cmp setup
eststo m1: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( log_overhead = i.country i.sector i.project i.own_area i.length i.source i.io_fe) , indicators($cmp_cont $cmp_cont) iterate(50) difficult
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#1)) force post
eststo overhead1

eststo m2: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( log_overhead = i.country i.sector i.project i.own_area i.length i.source i.io_fe) , indicators($cmp_probit $cmp_cont) iterate(50) difficult 
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#2)) force post
eststo overhead2

*amount
eststo m3: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe) ( log_amount = i.country i.sector i.project i.own_area i.length i.source i.io_fe)  , indicators($cmp_cont $cmp_cont) iterate(50) difficult 
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#1)) force post
eststo amount1

eststo m4: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe ) ( log_amount = i.country i.sector i.project i.own_area i.length i.source i.io_fe ) , indicators($cmp_probit $cmp_cont) iterate(50) difficult 
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#2)) force post
eststo amount2

*Coefficient plot

*overhead
coefplot overhead1 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(overhead1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(0.05)0.3)

coefplot overhead2 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(overhead2, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  

*amount
coefplot amount1 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(amount1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(0.05)0.3)

coefplot amount2 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(amount2, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  

graph combine amount2 overhead2, scheme(plotplainblind) 


********************************
*Figure A15: Excluding LinkedIn*
********************************

gen linkedin=1 if data=="linkedin"
replace linkedin=0 if missing(linkedin)

eststo m1: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe ) ( overhead_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe ) if linkedin==0, indicators($cmp_cont $cmp_cont) iterate(50) difficult
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#1)) force post
eststo overhead1

eststo m2: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe ) ( overhead_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe )  if linkedin==0, indicators($cmp_probit $cmp_cont) iterate(50) difficult 
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#2)) force post
eststo overhead2

*amount
eststo m3: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe ) ( amount_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe )  if linkedin==0, indicators($cmp_cont $cmp_cont) iterate(50) difficult 
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#1)) force post
eststo amount1

eststo m4: cmp (refuse = i.country i.sector i.project i.own_area i.length i.source i.io_fe ) ( amount_clean = i.country i.sector i.project i.own_area i.length i.source i.io_fe ) if linkedin==0, indicators($cmp_probit $cmp_cont) iterate(50) difficult 
margins country sector project own_area length source i.io_fe, atmeans predict(eq(#2)) force post
eststo amount2

*Coefficient plot

*overhead
coefplot overhead1 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(overhead1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(0.05)0.3)

coefplot overhead2 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(overhead2, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(2)20)

*amount
coefplot amount1 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(amount1, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(0.05)0.3)

coefplot amount2 , xtitle(Marginal Means) scheme(plotplainblind)  drop(*io_fe) name(amount2, replace) headings(0.country = "{bf:Earmarked to country}" 0.sector = "{bf:Earmarked to sector}" 0.project = "{bf:Earmarked to project}" 0.own_area = "{bf:Earmarked to workarea}" 0.length = "{bf:Length}" 0.source = "{bf:Donor}" )  xlabel(0(2)20)

graph combine amount2 overhead2, scheme(plotplainblind) 

*******************************
*Figure A5: Benjamini-Hochberg*
*******************************

*to get the BH estimates, rank the outputs by p-value and calculate the BH value using: (i/m)Q, where: i = the individual p-value's rank, m = total number of tests, Q = the false discovery rate (0.05)

reghdfe refuse  i.country i.sector i.project i.own_area i.length i.source  , absorb(q26)  vce(cluster id)
estimates store m1, title()

reghdfe overhead_clean  i.country i.sector i.project i.own_area i.length i.source  , absorb(q26)  vce(cluster id)
estimates store m2, title()

reghdfe amount_clean  i.country i.sector i.project i.own_area i.length i.source  , absorb(q26)  vce(cluster id)
estimates store m3, title()

reghdfe choicevar_clean  i.country i.sector i.project i.own_area i.length i.source  , absorb(q26)  vce(cluster id)
estimates store m4, title()

esttab m1 m2 m3 m4  using BH_TableA5.rtf, star(* 0.05  + 0.006) b(4) ///
p r2 label drop(_cons)  indicate(`r(indicate_fe)') 





